<script lang="ts" setup>
defineOptions({
	name: 'LanguageTest'
})

const languageStore = useLanguageStore()
const { currentLanguage } = storeToRefs(languageStore)
</script>

<template>
	<IsGuest>
		<div class="p-4">
			<h1 class="text-2xl font-bold mb-4">{{ t('切换语言') }}</h1>
			<div class="mb-6">
				<LanguageSwitch />
			</div>
			<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
				<div class="border rounded-lg p-4">
					<h2 class="text-lg font-semibold mb-2">当前语言信息</h2>
					<p>
						<strong>语言代码:</strong>
						{{ currentLanguage }}
					</p>
				</div>
				<div class="border rounded-lg p-4">
					<h2 class="text-lg font-semibold mb-2">翻译测试</h2>
					<p>
						<strong>保存:</strong>
						{{ t('保存') }}
					</p>
					<p>
						<strong>取消:</strong>
						{{ t('取消') }}
					</p>
					<p>
						<strong>搜索:</strong>
						{{ t('搜索') }}
					</p>
					<p>
						<strong>首页:</strong>
						{{ t('首页') }}
					</p>
				</div>
			</div>
		</div>
	</IsGuest>
</template>
